x86/hvm: add logging for hypercalls
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 15 May 2007 09:43:59 +0000 (10:43 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 15 May 2007 09:43:59 +0000 (10:43 +0100)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/hvm/hvm.c
xen/include/asm-x86/hvm/support.h

index 0f042ea4f89f5c0ac098d1ca10974ef429574daa..9a2135254371e1dceda9b107000c8b228f73bc11 100644 (file)
@@ -776,6 +776,9 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
 #ifdef __x86_64__
     if ( mode == 8 )
     {
+        HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%lx, %lx, %lx, %lx, %lx)", eax,
+                    regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8);
+
         regs->rax = hvm_hypercall64_table[eax](regs->rdi,
                                                regs->rsi,
                                                regs->rdx,
@@ -785,6 +788,11 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
     else
 #endif
     {
+        HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u(%x, %x, %x, %x, %x)", eax,
+                    (uint32_t)regs->ebx, (uint32_t)regs->ecx,
+                    (uint32_t)regs->edx, (uint32_t)regs->esi,
+                    (uint32_t)regs->edi);
+
         regs->eax = hvm_hypercall32_table[eax]((uint32_t)regs->ebx,
                                                (uint32_t)regs->ecx,
                                                (uint32_t)regs->edx,
@@ -792,6 +800,8 @@ int hvm_do_hypercall(struct cpu_user_regs *regs)
                                                (uint32_t)regs->edi);
     }
 
+    HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%u -> %lx", eax, (unsigned long)regs->eax);
+
     return (this_cpu(hc_preempted) ? HVM_HCALL_preempted :
             flush ? HVM_HCALL_invalidate : HVM_HCALL_completed);
 }
@@ -1054,6 +1064,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
             rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
         }
 
+        HVM_DBG_LOG(DBG_LEVEL_HCALL, "%s param %u = %"PRIx64,
+                    op == HVMOP_set_param ? "set" : "get",
+                    a.index, a.value);
+
     param_fail:
         rcu_unlock_domain(d);
         break;
index efbc2b39b0a89ceec84bf85c56a0ebe79d38b58b..74d923cb1048613678234d6914fb29bddac18515 100644 (file)
@@ -62,6 +62,7 @@ static inline vcpu_iodata_t *get_ioreq(struct vcpu *v)
 #define DBG_LEVEL_VLAPIC_TIMER      (1 << 7)
 #define DBG_LEVEL_VLAPIC_INTERRUPT  (1 << 8)
 #define DBG_LEVEL_IOAPIC            (1 << 9)
+#define DBG_LEVEL_HCALL             (1 << 10)
 
 extern unsigned int opt_hvm_debug_level;
 #define HVM_DBG_LOG(level, _f, _a...)                                         \